package com.y.architecture.base_refresh_load;

import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.y.architecture.base.IBaseContact;
import com.y.architecture.base_refresh.IBaseRefreshContact;
import com.y.architecture.recycle_util.BaseQuickAdapter;
import com.y.architecture.recycle_util.BaseViewHolder;

import java.util.List;

/**
 * Created by youjingjing on 2017/11/28.
 */

public class IBaseRefreshLoadContact {
    public interface IBaseRefreshLoadView<T> extends IBaseContact.IBase, IBaseRefreshContact.IBaseRefreshView,
            BaseQuickAdapter.RequestLoadMoreListener, BaseQuickAdapter.OnItemClickListener {

        void initRefreshLoad(Bundle saveInstanceStatus);

        void setLayoutManager();

        void setAdapter();

        BaseQuickAdapter<T, BaseViewHolder> getAdapter();

        BaseQuickAdapter<T, BaseViewHolder> getGenerateAdapter();

        boolean isShowDivider();

        void addDivider();

        void onEmptyViewClicked(View view);

        List<T> getItems();

        void refreshLoadComplete(boolean success);

        boolean isSuccess(List<T> backData);

        void loadData(final int page);

        void onLoadMoreRequested();

    }

    public interface IBaseRefreshLoadPresenter<T> extends IBaseContact.IPresenter {

        RecyclerView.LayoutManager setDefaultLayoutManager();

        RecyclerView.Adapter setAdapter();

        View setEmptyView();

        void addDivider();

        RecyclerView initRecycleView();

//        void onRefreshBegin(SwipeRefreshLayout frame);
//        void onLoadBegin(SpinKitView frame);
    }
}
